interface Ipeople{
	name:string|undefined,
	age:number|undefined,
	family:Array<string>|undefined
}

function print(student:Ipeople):void{
	console.log(student.name+"已经"+student.age+"岁了")
}

class stu implements Ipeople{
	public name;
	public age;
	public family;
	public school:string|undefined;
	constructor()
	constructor(student?:Ipeople)
	constructor(name?:string,age?:number)
	constructor(student?:Ipeople,school?:string)
	constructor(student?:Ipeople,school?:string)
	constructor(student?:Ipeople|string,school?:string|number){
		if(typeof student == "string"){
			this.name=<string>student
			this.age=<number>school||0
		}else{
			this.name=student?.name;
			this.age=student?.age;
			this.family=student?.family||[]
			this.school=<string>school||"";
		}
		
	}
}
var ss:Ipeople={
	name:"小明",
	age:18,
	family:["弟弟","妹妹"]
}
var stud=new stu(ss,"北京");
console.log(stud)